﻿<?php
	include '../inc/conn.php';
	
	session_start();	
?>
<?
	extract($_POST);
	extract($_GET);
	unset($_POST,$_GET);
	if (isset($act) && isset($id))
	{
		if ($act == "del"){
			$db = new mysql();
			$db->delete('validate_issues', "id=".$id);
			$db->close();
			echo "<script>alert('Data has deleted!!!');window.location='admin_index.php?name=issue';</script>";
		}
	}
?>
<div class="container-fluid">
	<? if ($_SESSION['user'] != 1){  
		echo '<script>window.location="userinfo.php"</script>';
	} else {
	?>
	<div class="panel panel-primary">
		<div class="panel-heading">
			<h3 class="panel-title">管理面板>>问题点汇总表</h3>
		</div>
		<div class="panel-body">
			<div>
				<table border=0 cellpadding=0 class="table table-striped">
				<tr class="success"><th>Item</th><th>问题点</th><th>分析人员</th><th>状态</th><th>Admin</th></tr>
				<?
				$db = new mysql();
				$db->query("select * from validate_issues ORDER BY val_date DESC");
				$num = $db->db_num_rows();
				for($i=0; $i<$num; $i++){
					$row = $db->fetch_assoc();
					$item = $i + 1;
					echo "			<tr>";
					echo "<td>$item</td>";
					echo "<td><a href=\"../review_issue.php?id=".$row['id']."\">".htmlspecialchars_decode($row['val_reason'])."</a></td>";
					echo "<td>".htmlspecialchars_decode($row['val_owner'])."</td>";
					if ($row['val_status']=="Open")
						echo "<td><font color=\"red\">".$row['val_status']."</font></td>";
					else if ($row['val_status']=="Tracking")
						echo "<td><font color=\"BLUE\">".$row['val_status']."</font></td>";
					else
						echo "<td>".$row['val_status']."</td>";
					echo "<td><a href='#' rel='tooltip' title='修改' onclick=\"javascript:window.open('mod_issue.php?id=${row['id']}', '修改', 'height=860, width=1200, toolbar=no, menubar=no, scrollbars=yes, resizable=yes,location=no, status=no');\"><span class=\"glyphicon glyphicon-edit\"></span></a>";
					if (isset($_SESSION['admin']))
						echo "&nbsp;|&nbsp;<a href=\"admin_issue.php?id=".$row['id']."&act=del\" rel='tooltip' title='删除问题点，当心哦~~~'><font color='red'><span class=\"glyphicon glyphicon-remove\"></span></font></a></td>";
					echo "</tr>\n";
				}
				?>
				</table>
			</div>
		</div>
	</div>
</div>
<? 
}
//	include 'bottom.php';
	$db->close();
?>
